<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/context/mytags.jsp" %>
<html>
<head>
    <title>Choose</title>
    <script type="text/javascript" src="plug-in/mutiLang/zh-cn.js"></script>
    <script type="text/javascript" src="plug-in/jquery/jquery-1.8.3.js"></script>
    <script type="text/javascript" src="plug-in/tools/dataformat.js"></script>
    <link id="easyuiTheme" rel="stylesheet" href="plug-in/easyui/themes/default/easyui.css" type="text/css"></link>
    <link rel="stylesheet" href="plug-in/easyui/themes/icon.css" type="text/css"></link>
    <link rel="stylesheet" type="text/css" href="plug-in/accordion/css/accordion.css">
    <script type="text/javascript" src="plug-in/easyui/jquery.easyui.min.1.3.2.js"></script>
    <script type="text/javascript" src="plug-in/easyui/locale/zh-cn.js"></script>
    <script type="text/javascript" src="plug-in/tools/syUtil.js"></script>
    <script type="text/javascript" src="plug-in/easyui/extends/datagrid-scrollview.js"></script>
    <script type="text/javascript" src="plug-in/My97DatePicker/WdatePicker.js"></script>
    <link rel="stylesheet" href="plug-in/tools/css/common.css" type="text/css"></link>
    <script type="text/javascript" src="plug-in/lhgDialog/lhgdialog.min.js"></script>
    <script type="text/javascript" src="plug-in/tools/curdtools_zh-cn.js"></script>
    <script type="text/javascript" src="plug-in/tools/easyuiextend.js"></script>
    <script type="text/javascript" src="plug-in/jquery-plugs/hftable/jquery-hftable.js"></script>
    <link rel="stylesheet" href="plug-in/jquery/jquery-autocomplete/jquery.autocomplete.css" type="text/css"></link>
    <script type="text/javascript" src="plug-in/jquery/jquery-autocomplete/jquery.autocomplete.min.js"></script>
</head>
<script>
    function fx(){
        var type=$("#type").val();
        var cbsId=$("#cbsId").val();
        $.ajax({
            url : "cbsDelinerController.do?judgeService",
            data : {"id" :cbsId},
            async:false,
            cache : false,
            dataType : 'json',
            type : 'POST',
            success : function(data){
                if(!data.success){
                    addOneTab('引擎翻新现场检测完工单', 'cbsServiceReportController.do?goEngineRefurbished&id=' + cbsId+'&type='+type);
                    frameElement.api.close();
                }
                if("type-yqfx"==data.msg){
                    addOneTab('引擎翻新现场检测完工单', 'cbsServiceReportController.do?goEngineRefurbished&id=' + cbsId+'&type='+type);
                    frameElement.api.close();
                }else{
                    parent.window.tip("该服务单已填写相应完工单，不能继续填写其他完工单");
                    frameElement.api.close();
                }

            }
        });
    }
    function jump() {
        var type=$("#type").val();
        var cbsId=$("#cbsId").val();
        $.ajax({
            url : "cbsDelinerController.do?judgeService",
            data : {"id" :cbsId},
            async:false,
            cache : false,
            dataType : 'json',
            type : 'POST',
            success : function(data){
                if(!data.success){
                    addOneTab('现场检测完工单', 'cbsServiceReportController.do?goReferDetection&id=' + cbsId+'&type='+type);
                    frameElement.api.close();
                }
                if("type-yj"==data.msg){
                    addOneTab('现场检测完工单', 'cbsServiceReportController.do?goReferDetection&id=' + cbsId+'&type='+type);
                    frameElement.api.close();
                }else{
                    parent.window.tip("该服务单已填写相应完工单，不能继续填写其他完工单");
                    frameElement.api.close();
                }

            }
        });
    }
</script>
<body>
<table class="nobordertable noborder" style="border: none; margin-top:50px;">
    <tbody>
    <tr>
        <input type="hidden" id="type" value="${type}" style="text-align:center;margin-right:20px;border-radius: 10px;padding: 15px;background-color: blue;">
        <input type="hidden" id="cbsId" value="${cbsId}" style="text-align:center;margin-right:20px;border-radius: 10px;padding: 15px;background-color: blue;">
        <td width="50%" style="text-align: center;margin-left:20px;border-radius: 10px;padding: 15px;background-color:blue;">
            <a class="btn-blue" onclick="fx()">引擎翻新</a>
        </td>
        <td width="50%" style="text-align: center;margin-left:20px;border-radius: 10px;padding: 15px;background-color: #f6a828;">
            <a class="btn-org" onclick="jump()">其他</a>
        </td>
    </tr>
    <tr>
        <td colspan="2" style="text-align: center">如引擎翻新的现场检测请选择引擎翻新，非引擎翻新的业务请选择其他。</td>
    </tr>
    </tbody>
</table>
</body>
</html>
